[jquery/javascript] Trigger function when mouse click inside textarea AND type stop typing...
Posted
by marc
on Stack Overflow
See other posts from Stack Overflow
or by marc
Published on 2010-04-11T16:58:01Z
Indexed on
2010/04/11
17:03 UTC
Read the original article
Hit count: 365
Welcome,
In short, my website use BBcode system, and i want allow users to preview message without posting it.
I'm using JQuery library.
I need 3 actions.
1) When user click in textarea i want display DIV what will contain preview, i want animate opening. 2) When user typing, i want dynamical load parsed by PHP code to DIV.
(i'm still thinking what will be best option... refresh every 2 seconds, or maybe we can detect and refresh after 1 second of inactivity [stop typing])
3) When user click outside textarea i want close preview div with animation.
For example the PHP parser will have patch /api/parser.php and variable by POST called $_POST['message'].
Any idea my digital friends ?
© Stack Overflow or respective owner